<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>解析json字符串</title>
</head>
<body>
<script>
    let jsonStr ='{"name":"tom","age":"20","gender":"男"}';
    let obj = JSON.parse(jsonStr);
    for (const key in obj){
        console.log(obj[key]);
    }
    let jsonObj={"name":"tom","age":20,"gender":"男"};
    let str = JSON.stringify(jsonStr);
    console.log(str);
    console.log(typeof str);
</script>
</body>
</html>